﻿<%@ Page Title="History Orders" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MyOrders.aspx.cs" Inherits="IFD2.MyOrders" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="HistoryOrders"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" Text="Scope:" meta:resourcekey="Scope"></asp:Label><br />
                <asp:RadioButton ID="radMine" runat="server" Checked="True" GroupName="radWhose" Text="My Orders" meta:resourcekey="MyOrders"/><br />
                <asp:RadioButton ID="radOffice" runat="server" GroupName="radWhose" Text="Office Orders" meta:resourcekey="OfficeOrders"/><br />
            </div>
            <div class="form-group">
                <asp:Label ID="Label2" runat="server" Text="Date Period:" meta:resourcekey="DatePeriod"></asp:Label>
                <asp:TextBox ID="txtDateFrom" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="15"></asp:TextBox>
                -<br />
                <asp:TextBox ID="txtDateTo" runat="server" CssClass="form-control input-sm" Width="100%" MaxLength="15"></asp:TextBox>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs" />
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="MyOrders"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:800px;width:100%;" class="table-hover"
                            DataKeyNames="bk_id" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField HeaderText="bk_id" SortExpression="bk_id" meta:resourcekey="bk_id">
                                    <ItemTemplate>
                                        <a href='Order.aspx?pnr=<%# Eval("bk_id") %>'> <%# Eval("bk_id") %> </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="create_date" HeaderText="create_date" SortExpression="create_date"  meta:resourcekey="create_date" />
                                <asp:BoundField DataField="contact_man" HeaderText="contact_man" SortExpression="contact_man"  meta:resourcekey="contact_man" />
                                <asp:BoundField DataField="mobile_phone" HeaderText="mobile_phone" SortExpression="mobile_phone"  meta:resourcekey="mobile_phone" />
                                <asp:BoundField DataField="status" HeaderText="status" SortExpression="status"  meta:resourcekey="status" />
                                <asp:BoundField DataField="adt_count" HeaderText="adt_count" SortExpression="adt_count"  meta:resourcekey="adt_count" />
                                <asp:BoundField DataField="chd_count" HeaderText="chd_count" SortExpression="chd_count"  meta:resourcekey="chd_count" />
                                <asp:BoundField DataField="inf_count" HeaderText="inf_count" SortExpression="inf_count"  meta:resourcekey="inf_count" />
                                <asp:BoundField DataField="sell_office" HeaderText="sell_office" SortExpression="sell_office"  meta:resourcekey="sell_office" />
                                <asp:BoundField DataField="sell_user" HeaderText="sell_user" SortExpression="sell_user"  meta:resourcekey="sell_user" />
                            </Columns>
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>

                        <asp:HiddenField ID="hidWho" runat="server" />
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_user_get_my_orders" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="hidWho" Name="flag" PropertyName="Value" Type="String" />
                                <asp:SessionParameter Name="office" SessionField="OFFICE" Type="String" />
                                <asp:SessionParameter Name="user" SessionField="USER" Type="String" />
                                <asp:ControlParameter ControlID="txtDateFrom" Name="date_from" PropertyName="Text"
                                    Type="DateTime" />
                                <asp:ControlParameter ControlID="txtDateTo" Name="date_to" PropertyName="Text" Type="DateTime" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                </div>
            </div>
        </div>
    </div>

    </div>
    <%--</ContentTemplate></asp:UpdatePanel>--%>
    </form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
